home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / music_utilities / pt030.dms / pt030.adf / Less / Less.doc < prev    next >
Text File  |  1987-06-15  |  15KB  |  463 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. _l_e_s_s - _o_p_p_o_s_i_t_e _o_f _m_o_r_e
  8.  
  9. _l_e_s_s [-_d_s_t_w_c_C_e_E_m_M_q_Q_u_U] [-_h_N] [-b[fp]_N] [-x_N] [-[z]_N]
  10.      [-_P[_m_M]_s_t_r_i_n_g] [-[lL]_l_o_g_f_i_l_e] [+_c_m_d]  [_f_i_l_e_n_a_m_e]...
  11.  
  12. _L_e_s_s is a program similar to  _m_o_r_e  (1),  but  which  allows
  13. backwards  movement in the file as well as forward movement.
  14. Also, _l_e_s_s does not have  to  read  the  entire  input  file
  15. before starting, so with large input files it starts up fas-
  16. ter than text editors like _v_i (1).  _L_e_s_s uses termcap, so it
  17. can  run  on  a variety of terminals.  There is even limited
  18. support for hardcopy terminals.  (On  a  hardcopy  terminal,
  19. lines  which  should be printed at the top of the screen are
  20. prefixed with an up-arrow.)
  21.  
  22.      Commands are based on both _m_o_r_e and _v_i.   Commands  may
  23. be  preceeded  by a decimal number, called N in the descrip-
  24. tions below.  The number is used by some commands, as  indi-
  25. cated.
  26.  
  27.  
  28. _I_n _t_h_e _f_o_l_l_o_w_i_n_g _d_e_s_c_r_i_p_t_i_o_n_s, ^_X _m_e_a_n_s _c_o_n_t_r_o_l-_X.
  29.  
  30. H    Help: display a summary of these commands.  If you for-
  31.      get all the other commands, remember this one.
  32.  
  33.  
  34. SPACEScroll forward N lines, default one window (see  option
  35.      -z below).  If N is more than the screen size, only the
  36.      final screenful is displayed.
  37.  
  38.  
  39. f or ^F
  40.      Same as SPACE.
  41.  
  42.  
  43. b or ^B
  44.      Scroll backward N lines, default one window (see option
  45.      -z below).  If N is more than the screen size, only the
  46.      final screenful is displayed.
  47.  
  48.  
  49. RETURNScroll forward N lines, default 1.  The entire N lines
  50.      are displayed, even if N is more than the screen size.
  51.  
  52.  
  53. e or ^E
  54.      Same as RETURN.
  55.  
  56.  
  57. j or ^J
  58.      Also the same as RETURN.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                         July 5, 1988
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                            - 2 -
  71.  
  72.  
  73. y or ^Y
  74.      Scroll backward N lines, default 1.  The entire N lines
  75.      are displayed, even if N is more than the screen size.
  76.  
  77. k or ^K
  78.      Same as y.
  79.  
  80.  
  81. d or ^D
  82.      Scroll forward N lines, default 10.  If N is specified,
  83.      it  becomes the new default for subsequent d and u com-
  84.      mands.
  85.  
  86.  
  87. u or ^U
  88.      Scroll backward N lines, default 10.  If  N  is  speci-
  89.      fied, it becomes the new default for subsequent d and u
  90.      commands.
  91.  
  92.  
  93. r or ^R or ^L
  94.      Repaint the screen.
  95.  
  96.  
  97. R    Repaint the  screen,  discarding  any  buffered  input.
  98.      Useful  if  the  file  is  changing  while  it is being
  99.      viewed.
  100.  
  101.  
  102. g    Go to line N in  the  file,  default  1  (beginning  of
  103.      file).  (Warning: this may be slow if N is large.)
  104.  
  105.  
  106. G    Go to line N in the file, default the end of the  file.
  107.      (Warning:  this  may  be slow if standard input, rather
  108.      than a file, is being read.)
  109.  
  110.  
  111. p    Go to a position N percent into the file.  N should  be
  112.      between 0 and 100.  (This is possible if standard input
  113.      is being read, but only if _l_e_s_s has already read to the
  114.      end  of  the  file.   It is always fast, but not always
  115.      useful.)
  116.  
  117.  
  118. %    Same as p.
  119.  
  120.  
  121. m    Followed by any lowercase  letter,  marks  the  current
  122.      position with that letter.
  123.  
  124.  
  125. '    (Single  quote.)  Followed  by  any  lowercase  letter,
  126.      returns  to  the  position  which was previously marked
  127.  
  128.  
  129.  
  130.                         July 5, 1988
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                            - 3 -
  137.  
  138.  
  139.      with that letter.  Followed by  another  single  quote,
  140.      returns  to the postion at which the last "large" move-
  141.      ment command was executed.  All marks are lost  when  a
  142.      new file is examined.
  143.  
  144.  
  145. /pattern
  146.      Search forward in the file for the N-th line containing
  147.      the  pattern.  N defaults to 1.  The pattern is a regu-
  148.      lar expression, as recognized by _e_d.  The search starts
  149.      at  the  second  line displayed (but see the -t option,
  150.      which changes this).
  151.  
  152.  
  153. ?pattern
  154.      Search backward in the file for the N-th line  contain-
  155.      ing the pattern.  The search starts at the line immedi-
  156.      ately before the top line displayed.
  157.  
  158.  
  159. n    Repeat previous search, for N-th  line  containing  the
  160.      last pattern.
  161.  
  162.  
  163. E    Examine a new file.  If the filename  is  missing,  the
  164.      "current"  file  (see  the N and P commands below) from
  165.      the list of files in the command line  is  re-examined.
  166.      If  the  filename  is  a pound sign (#), the previously
  167.      examined file is re-examined.
  168.  
  169.  
  170. N    Examine the next file (from the list of files given  in
  171.      the  command line).  If a number N is specified (not to
  172.      be confused with the command N), the N-th next file  is
  173.      examined.
  174.  
  175.  
  176. P    Examine the previous file.  If a number N is specified,
  177.      the N-th previous file is examined.
  178.  
  179.  
  180. = or ^G
  181.      Prints some information about the  file  being  viewed,
  182.      including  its  name  and the byte offset of the bottom
  183.      line being displayed.  If possible, it also prints  the
  184.      length  of  the  file and the percent of the file above
  185.      the last displayed line.
  186.  
  187.  
  188. -    Followed by one of the command line option letters (see
  189.      below), this will toggle the setting of that option and
  190.      print a message describing the new setting.
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                         July 5, 1988
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                            - 4 -
  203.  
  204.  
  205. +cmd Causes the specified cmd to be executed each time a new
  206.      file  is examined.  For example, +G causes _l_e_s_s to ini-
  207.      tially display each file starting  at  the  end  rather
  208.      than the beginning.
  209.  
  210.  
  211. V    Prints the version number of _l_e_s_s being run.
  212.  
  213.  
  214. q    Exits _l_e_s_s.
  215.  
  216.      The following two commands may or  may  not  be  valid,
  217. depending on your particular installation.
  218.  
  219.  
  220. v    Invokes an  editor  to  edit  the  current  file  being
  221.      viewed.  The editor is taken from the environment vari-
  222.      able EDITOR, or defaults to "vi".
  223.  
  224.  
  225. ! shell-command
  226.      Invokes a shell to run the shell-command given.  A per-
  227.      cent sign in the command is replaced by the name of the
  228.      current file.  "!!" repeats the last shell command.
  229.  
  230.  
  231. _C_o_m_m_a_n_d _l_i_n_e _o_p_t_i_o_n_s _a_r_e _d_e_s_c_r_i_b_e_d _b_e_l_o_w.  _M_o_s_t _o_p_t_i_o_n_s  _m_a_y
  232. _b_e _c_h_a_n_g_e_d _w_h_i_l_e _l_e_s_s is running, via the "-" command.
  233.  
  234.      Options are also taken from  the  environment  variable
  235. "LESS".   For  example, if you like more-style prompting, to
  236. avoid typing "less -m ..." each time _l_e_s_s  is  invoked,  you
  237. might tell _c_s_h:
  238.  
  239. setenv LESS m
  240.  
  241. or if you use _s_h:
  242.  
  243. LESS=m; export LESS
  244.  
  245. The environment variable is parsed before the command  line,
  246. so  command line options override the LESS environment vari-
  247. able.  A dollar sign ($) may be used to signal the end of an
  248. option  string.   This is important only for options like -P
  249. which take a following string.
  250.  
  251. -b   The -b_n option tells _l_e_s_s to use a non-standard  buffer
  252.      size.   There  are two standard (default) buffer sizes,
  253.      one is used when a file is being  read  and  the  other
  254.      when  a  pipe  (standard  input)  is  being  read.  The
  255.      current defaults are 5 buffers for  files  and  12  for
  256.      pipes.   (Buffers  are 1024 bytes.) The number _n speci-
  257.      fies a different number of buffers to use.  The -b  may
  258.      be followed by "f", in which case only the file default
  259.  
  260.  
  261.  
  262.                         July 5, 1988
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                            - 5 -
  269.  
  270.  
  271.      is changed, or by "p"  in  which  case  only  the  pipe
  272.      default is changed.  Otherwise, both are changed.
  273.  
  274. -c   Normally, _l_e_s_s will repaint  the  screen  by  scrolling
  275.      from  the  bottom  of  the screen.  If the -c option is
  276.      set, when _l_e_s_s needs to change the entire  display,  it
  277.      will paint from the top line down.
  278.  
  279. -C   The -C option is like -c, but  the  screen  is  cleared
  280.      before it is repainted.
  281.  
  282. -d   Normally, _l_e_s_s will complain if the terminal  is  dumb;
  283.      that  is,  lacks some important capability, such as the
  284.      ability to clear the screen or scroll  backwards.   The
  285.      -d  option suppresses this complaint (but does not oth-
  286.      erwise change the behavior of the  program  on  a  dumb
  287.      terminal).
  288.  
  289. -e   Normally the only way to exit less is via the "q"  com-
  290.      mand.   The  -e option tells less to automatically exit
  291.      the second time it reaches end-of-file.
  292.  
  293. -E   The -E flag causes less  to  exit  the  first  time  it
  294.      reaches end-of-file.
  295.  
  296. -h   Normally, _l_e_s_s will  scroll  backwards  when  backwards
  297.      movement  is necessary.  The -h option specifies a max-
  298.      imum number of lines to scroll  backwards.   If  it  is
  299.      necessary  to move backwards more than this many lines,
  300.      the screen is repainted in a  forward  direction.   (If
  301.      the  terminal does not have the ability to scroll back-
  302.      wards, -h0 is implied.)
  303.  
  304. -l   The -l option, followed immediately by a filename, will
  305.      cause _l_e_s_s to copy its input to the named file as it is
  306.      being viewed.  This applies only when the input file is
  307.      a  pipe,  not  an  ordinary  file.  If the file already
  308.      exists, less will ask for confirmation before overwrit-
  309.      ing it.
  310.  
  311. -L   The -L option is like -l,  but  it  will  overwrite  an
  312.      existing file without asking for confirmation.
  313.  
  314. -m   Normally, _l_e_s_s prompts with a  colon.   The  -m  option
  315.      causes  _l_e_s_s  to prompt verbosely (like _m_o_r_e), with the
  316.      percent into the file.
  317.  
  318. -M   The -M option causes _l_e_s_s to prompt even more verbosely
  319.      than _m_o_r_e.
  320.  
  321. -P   The -P option provides a way to tailor the three prompt
  322.      styles  to your own preference.  You would normally put
  323.      this option in your LESS environment  variable,  rather
  324.      than type it in with each less command.  Such an option
  325.  
  326.  
  327.  
  328.                         July 5, 1988
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                            - 6 -
  335.  
  336.  
  337.      must either be the last option in the LESS variable, or
  338.      be  terminated  by  a  dollar  sign.   -P followed by a
  339.      string changes  the  default  (short)  prompt  to  that
  340.      string.   -Pm  changes  the  medium  (-m) prompt to the
  341.      string, and -PM changes  the  long  (-M)  prompt.   The
  342.      string  consists  of  a  sequence  of letters which are
  343.      replaced with certain predefined strings, as follows:
  344.           Ffile name
  345.           ffile name, only once
  346.           Ofile n of n
  347.           ofile n of n, only once
  348.           bbyte offset
  349.           ppercent into file
  350.           Ppercent if known, else byte offset
  351.      Angle brackets, < and >, may  be  used  to  surround  a
  352.      literal  string  to  be  included  in  the prompt.  The
  353.      defaults are "fo" for the short prompt, "foP"  for  the
  354.      medium prompt, and "Fobp" for the long prompt.
  355.      Example: Setting your LESS variable  to  "PmFOP$PMFObp"
  356.      would  change  the  medium  and  long prompts to always
  357.      include the file name and "file n of n" message.
  358.      Another example: Setting your LESS variable to
  359.      "mPm<--Less-->FoPe" would change the medium  prompt  to
  360.      the  string  "--Less--"  followed  by the file name and
  361.      percent into the file.   It  also  selects  the  medium
  362.      prompt  as  the  default  prompt  (because of the first
  363.      "m").
  364.  
  365. -q   Normally, if an attempt is made to scroll past the  end
  366.      of  the  file  or before the beginning of the file, the
  367.      terminal bell is rung to indicate this  fact.   The  -q
  368.      option  tells  _l_e_s_s not to ring the bell at such times.
  369.      If the  terminal  has  a  "visual  bell",  it  is  used
  370.      instead.
  371.  
  372. -Q   Even if -q is given, _l_e_s_s will ring the bell on certain
  373.      other errors, such as typing an invalid character.  The
  374.      -Q option tells _l_e_s_s to be quiet all the time; that is,
  375.      never  ring  the  terminal bell.  If the terminal has a
  376.      "visual bell", it is used instead.
  377.  
  378. -s   The -s option causes  consecutive  blank  lines  to  be
  379.      squeezed into a single blank line.  This is useful when
  380.      viewing _n_r_o_f_f output.
  381.  
  382. -t   Normally, forward searches start  just  after  the  top
  383.      displayed line (that is, at the second displayed line).
  384.      Thus forward searches include the  currently  displayed
  385.      screen.  The -t option causes forward searches to start
  386.      just after the bottom line displayed, thus skipping the
  387.      currently displayed screen.
  388.  
  389. -u   If the -u option is given, backspaces  are  treated  as
  390.      printable  characters;  that  is,  they are sent to the
  391.  
  392.  
  393.  
  394.                         July 5, 1988
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                            - 7 -
  401.  
  402.  
  403.      terminal when they appear in the input.
  404.  
  405. -U   If the -U option is given, backspaces  are  printed  as
  406.      the two character sequence "^H".
  407.  
  408.      If neither -u nor -U is given, backspaces which  appear
  409.      adjacent  to  an  underscore character are treated spe-
  410.      cially: the underlined  text  is  displayed  using  the
  411.      terminal's   hardware  underlining  capability.   Also,
  412.      backspaces which appear between two  identical  charac-
  413.      ters  are  treated  specially:  the  overstruck text is
  414.      printed using the terminal's hardware boldface capabil-
  415.      ity.   Other  backspaces  are  deleted,  along with the
  416.      preceeding character.
  417.  
  418. -w   Normally, _l_e_s_s uses  a  tilde  character  to  represent
  419.      lines  past  the end of the file.  The -w option causes
  420.      blank lines to be used instead.
  421.  
  422. -x   The -x_n option sets tab stops every _n  positions.   The
  423.      default for _n is 8.
  424.  
  425. -[z] When given a backwards or forwards window command, _l_e_s_s
  426.      will  by  default  scroll  backwards  or  forwards  one
  427.      screenful of lines. The -z_n option changes the  default
  428.      scrolling window size to _n lines.  If _n is greater than
  429.      the screen size, the scrolling window size will be  set
  430.      to  one  screenful.  Note  that the "z" is optional for
  431.      compatibility with _m_o_r_e.
  432.  
  433. +    If a command line option begins with +,  the  remainder
  434.      of  that  option  is  taken to be an initial command to
  435.      _l_e_s_s.  For example, +G tells _l_e_s_s to start at  the  end
  436.      of  the file rather than the beginning, and +/xyz tells
  437.      it to start at the first  occurence  of  "xyz"  in  the
  438.      file.    As   a   special  case,  +<number>  acts  like
  439.      +<number>g; that is,  it  starts  the  display  at  the
  440.      specified  line  number  (however, see the caveat under
  441.      the "g" command above).  If the option starts with  ++,
  442.      the initial command applies to every file being viewed,
  443.      not just the first one.  The + command described previ-
  444.      ously  may  also  be used to set (or change) an initial
  445.      command for every file.
  446.  
  447.  
  448. _W_h_e_n _u_s_e_d _o_n _s_t_a_n_d_a_r_d _i_n_p_u_t (_r_a_t_h_e_r _t_h_a_n _a  _f_i_l_e),  _y_o_u  _c_a_n
  449. _m_o_v_e  _b_a_c_k_w_a_r_d_s  _o_n_l_y _a _f_i_n_i_t_e _a_m_o_u_n_t, _c_o_r_r_e_s_p_o_n_d_i_n_g _t_o _t_h_a_t
  450. _p_o_r_t_i_o_n _o_f _t_h_e _f_i_l_e _w_h_i_c_h _i_s _s_t_i_l_l _b_u_f_f_e_r_e_d.  _T_h_e -_b  _o_p_t_i_o_n
  451. _m_a_y _b_e _u_s_e_d _t_o _e_x_p_a_n_d _t_h_e _b_u_f_f_e_r _s_p_a_c_e.
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                         July 5, 1988
  461.  
  462.  
  463.